<?php


namespace app\admin\validate;


use think\Validate;

class Pick extends Validate
{
    protected $regex = [
        'mobile'                =>      '/1[3456789]\d{9}$/',
        'idcard'                =>      '/^(\d{15}|\d{18}|\d{17}x)$/i',
        'bank_card'             =>      '/^(\d{16}|\d{17}|\d{19})$/',
    ];
    protected $rule = [
        'store_name'            =>      'require|unique:store',
//        'seller_name'           =>      'require|unique:store',
        'contacts_name'         =>      'require',
        'contacts_mobile'       =>      'require',
//        'idcard'                =>      'require|regex:idcard',
//        'profits_bili'          =>      'require|float',
//        'rebate_bili'           =>      'require|float',
//        'user_cancle_time'      =>      'require|float',
        'district'              =>      'require',
        'store_address'         =>      'require',
        'store_logo'            =>      'require',
    ];
    protected $message = [
        'store_name.require'            => '请输入店铺名称',
        'store_name.unique'             => '店铺名称已存在',
        'seller_name.require'           => '请输入登录账号',
        'seller_name.unique'            => '登录账号已存在',
        'contacts_name.require'         => '请输入联系人',
        'contacts_mobile.require'       => '请输入联系电话',
        'idcard.require'                => '请输入身份证号',
        'idcard.regex'                  => '身份证号格式有误',
        'profits_bili.require'          => '请输入让利比例',
        'profits_bili.float'            => '让利比例只能为数字',
        'rebate_bili.require'           => '请输入返利比例',
        'rebate_bili.float'             => '返利比例只能为数字',
        'user_cancle_time.require'      => '请输入取消时间',
        'user_cancle_time.float'        => '取消时间只能为数字',
        'district.require'              => '请选择所在地区',
        'store_address.require'         => '请输入详细地址',
        'store_logo.require'            => '请上传门头照片',
    ];
}
